package freezzz.client;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.ServiceDefTarget;

import java.util.Date;

import freezzz.client.EventWidget.TimelineEvent;

public interface TestService extends RemoteService {


    TimelineEvent[] getEventData ();

    TimelineEvent[] getEventForDate ( Date date );

    /**
     * Utility/Convenience class.
     * Use MyService.App.getInstance() to access static instance of MyServiceAsync
     */

    public static class App {
        private static final TestServiceAsync ourInstance;

        static {
            ourInstance = ( TestServiceAsync ) GWT.create ( TestService.class );
            ( ( ServiceDefTarget ) ourInstance ).setServiceEntryPoint ( "/freezzz.EventsTimeLine/TestService" );
        }

        public static TestServiceAsync getInstance () {
            return ourInstance;
        }
    }
}
